--------------------------------------------------------------------------------
-- \file     convert.lua
-- \brief    Converts defines to lua tables for peripheral emulation
-- \version  1
-- \date     2013-03-11 1:08PM
-- \author   ACV
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
-- \brief Global Begin / End functions
-- These are called at the begin and end of the program execution
--------------------------------------------------------------------------------
function GlobBegin()
	print('global begin')
end
function GlobEnd()
	print('global end')
end

--------------------------------------------------------------------------------
-- \brief Local Begin / End functions
-- These are called at the begin and end of the program execution
--------------------------------------------------------------------------------
function LocalBegin(fn)
	print('local begin')
end
function LocalEnd(fn)
	print('local end')
end

--------------------------------------------------------------------------------
-- \brief Processing function
-- This function processes each file in the order specified on the command line
--------------------------------------------------------------------------------
function Process(fn)
	print('process '..fn)
--[[
	for line in io.lines(fn) do
		print(line)
	end
--]]
end

--------------------------------------------------------------------------------
-- \brief AWK like processing
-- Handles single or multiple files
--------------------------------------------------------------------------------
GlobBegin()
for v=1,#arg do
	LocalBegin(arg[v])
	Process(arg[v])
	LocalEnd(arg[v])
end
GlobEnd()

--
--	End: convert.lua
--
